package com.qidianit.mes.pojo.pro;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qidianit.mes.pojo.Material;
import com.qidianit.mes.pojo.Unit;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @Author: YKYB
 * @Date: 2025/9/25 16:57
 * @Description:
 */
@Data
@TableName("bom_relation")
public class BomRelation {
    private Long id;
    @TableField("parent_id")
    private Long parentId;

    @TableField("child_id")
    private Long childId;

    @TableField("unit_id")
    private Long unitId;

    private BigDecimal quantity;

    private String remarks;

    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime createTime;

    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime updateTime;

    @TableField("delete_flag")
    private Integer deleteFlag;

    private Material parentMaterial; // 父项物料信息

    private Material childMaterial;  // 子项物料信息

    private Unit unit;
}
